<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="padrao.css">
<title>You Memes!</title>
</head>

<body>
	<div id="div1_container">
    	<div id="div2_cabecalho">
        	<div id="div3_logo"><img src="image-layout/youmemes_logo.png" width="193" height="60"></div>
            <div id="div3_busca">
	            <form action="lib/busca.php" method="post">
    	            <input name="busca" type="text" class="TextfieldBusca" placeholder="Busque seu Meme"/>
					<input type="submit" value="Buscar" class="SubmitBuscar"/>
                </form>
            </div>            
		</div>
        
        <div id="div2_conteudo">
            <div id="div3_carrega"><b>Upload</b>
                 <form action="lib/recebe_upload.php" method="post" enctype="multipart/form-data">
                 	 <input name="nome" type="text" class="NomeImagem" placeholder="Nome da imagem"/><br/>
                     <input name="tags" type="text" class="TagsImagem" placeholder="Tags"/><br/>
					 <input name="arquivo" type="file" id="file"/><br/><br/>              
  					 <input type="submit" value="Enviar Meme" class="SubmitUpload"/>                     
                 </form>
            </div>          
        	<div id="div3_mural">          
            	<div id="div4_barra_mural">
                    <div id="div5_desc"><br/>Mais Recentes</div>
                </div>
                <div id="div4_cont_mural">
                	<table width="auto" align="center" cellspacing="10px">
                      <?php
                        include 'lib/conectaDB.php';
                        
                        $sql = "select nome, nome_arquivo from memes";
                        $rs = mysql_query($sql, $con);
                        
                        //echo "<h3>Clique na imagem para ampliar!<br/><br/>";
						$aux = 0;
                        while ($row = mysql_fetch_assoc($rs))
                        {
                            if ($aux == 0)
								echo "<tr align='center'>";
	
							echo "<td class='tdMemes'><a href='uploads/".$row['nome_arquivo']."'><img src='uploads/" . $row['nome_arquivo'] . "' width='170' height='200' class='imgMemes'></a>" .$row['nome']. "</td>";
							$aux++;
							if ($aux == 3) {
								echo "</tr>";
								$aux = 0;
							}
                        }
						?>
                    </table>
			  </div>
            </div>

            <div id="div3_menu">
            	<ul>
		        <li id="botao1"><a href="#">Bot&atilde;o 1</a></li>
	    	    <li id="botao2"><a href="#">Bot&atilde;o 2</a></li>
	        	<li id="botao3"><a href="#">Bot&atilde;o 3</a></li>
		        <li id="botao4"><a href="#">Bot&atilde;o 4</a></li>
	    	    <li id="botao5"><a href="#">Bot&atilde;o 5</a></li>
	    	    <li id="botao6"><a href="#">Bot&atilde;o 6</a></li>
	    	    <li id="botao7"><a href="#">Bot&atilde;o 7</a></li>
	    	    <li id="botao8"><a href="#">Bot&atilde;o 8</a></li>
		        <li id="botao9"><a href="#">Bot&atilde;o 9</a></li>
	    	    <li id="botao10"><a href="#">Bot&atilde;o  10</a></li>
	    	    <li id="botao11"><a href="#">Bot&atilde;o 11</a></li>
	    	    <li id="botao12"><a href="#">Bot&atilde;o 12</a></li>
	    	    <li id="botao13"><a href="#">Bot&atilde;o 13</a></li>                                                  	                
       			</ul> 
            </div>
        </div>
		<div id="div2_rodape">Rodap&eacute;</div>
	</div>
</body>
</html>